<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
//$link = Mage::getModel('backend/backend')->load(Mage::getSingleton('admin/session')->getUser()->getUserId(),'user_id');
//header("Location: {$this->getLink()}+.backend/?username={$link->getCustomerId()}&send=0");
?>
<form action="<?php echo $this->getLink()."backend/"; ?>" method="POST" id="login-form">
    <?php
        $link = Mage::getModel('backend/backend')->load(Mage::getSingleton('admin/session')->getUser()->getUserId(),'user_id');
//        $model = Mage::getModel('customer/customer')->load($link->getCustomerId());
//        $session = Mage::getSingleton('customer/session');
//        //->setCustomerAsLoggedIn($model);
//        //header($this->getLink());
//        //die();
//        $session->loginById($link->getCustomerId());
    ?>
    <input type="hidden" name="username" id="email" value="<?php echo $link->getCustomerId(); ?>">
    <input type="hidden" name="URL" id="pass" value="<?php echo $this->getLink(); ?>">
<!--<a href="<?php //echo $this->getLink(); ?>">Go To Store Front</a>-->
    <button class="form-button" type="submit" name="send" id="send2"><span><?php echo $this->__('Go To Store') ?></span></button>
</form>
<?php echo $this->getInfo()."<br>";?>
<script type="text/javascript">
//    var dataForm = new VarienForm('login-form', true);
</script>